<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <p>123456</p>
  <h1></h1>
  <h1>1234565</h1>
  <H1>1234565</H1>
  
</body>
<script>
  const body=document.body
  body.innerHTML= body.innerHTML.replace(/<(h[1-6])>[\d\D]*<\/\1>/gi,"")
</script>
</html>